#!/bin/sh

echo "Starting Plot Manager installer preflight script";

TARGET_LOCATION=$2

  if [ -f "$TARGET_LOCATION/PAD System 6.0/PlotManager/PlotManager.app/Contents/MacOS/PlotManager" ] ; then
    echo "Deactivate Plot Manager by selected path";
    "$TARGET_LOCATION"/PAD\ System\ 6.0/PlotManager/PlotManager.app/Contents/MacOS/PlotManager close_all:  
  else 
    if [ -f "/Applications/PAD System 6.0/PlotManager/PlotManager.app/Contents/MacOS/PlotManager" ] ; then
      echo "Deactivate Plot Manager by default path";
      /Applications/PAD\ System\ 6.0/PlotManager/PlotManager.app/Contents/MacOS/PlotManager close_all:
    fi
  fi

echo "Ending Plot Manager installer preflight script";

exit 0;